<script>
$(document).ready(function(){
	{params}
	
	var c = {
		cnum:'',
		init:function(){
			if(params.cnum)this.cnum = params.cnum;
			this.isnew = params.isnew;
			this.isapp = params.isapp;
			if(this.isnew){
				importcss('chat');
			}
			if(this.isapp){
				//$('#name_{rand}').parent().hide();
			}
			this.initshow(params);
			importjs('chat', function(){
				c.initchat();
			});
		},
		initchat:function(){
			this.chat = new js.chat.create({
				info:this.info,
				cnum:this.cnum,
				isnew:this.isnew,
				ismobile:1,
				optobj:this,
				rand:'{rand}'
			});
		},
		initshow:function(d){
			this.info 	= d;
			var s = '<b>'+d.name+'</b>';
			if(d.ranking)s+=' <span style="font-size:14px;color:#aaaaaa">('+d.ranking+')</span>';
			if(d.bqname)s+='<span style="margin-left:2px;font-size:10px;background:'+d.bqcolor+'" class="rock-badge">'+d.bqname+'</span>';
			$('#name_{rand}').html(s);
			s = '';
			if(d.deptname)s+='<span style="font-size:12px;color:#aaaaaa">'+d.deptname+'</span>';
			$('#subname_{rand}').html(s);
			//get('face_{rand}').src = getface(d.face);
			
			s = '';
			if(d.type==1){
				s += '<span tools="exit" class="rock-header-btn"><i class="icon-signout"></i></span>';
				s += '<span tools="add" class="rock-header-btn"><i class="icon-plus-sign"></i></span>';
				s += '<span tools="group" class="rock-header-btn"><i class="icon-group"></i></span>';
			}
			if(d.type==0){
				//s += '<span tools="info" class="toolsspan"><i class="icon-user"></i></a></span>';
			}
			
			$('#rightbtn_{rand}').html(s);
		},
		showtitle:function(d){
			var s = '<b>'+d.name+'</b>';
			if(d.ushu)s+=' <span style="font-size:14px;color:#aaaaaa">('+d.ushu+')</span>';
			if(d.bqname)s+='<span style="margin-left:2px;font-size:10px;background:'+d.bqcolor+'" class="rock-badge">'+d.bqname+'</span>';
			$('#name_{rand}').html(s);
			//if(d.face)get('face_{rand}').src = d.face;
		},
		close:function(){
			reim.closetabs(params.bh);
		},
		send:function(){
			this.chat.sendcont();
		},
		sendtools:function(o1,s1,s2,evt){
			this.chat.sendtools(o1,evt);
		}
	}
	
	js.initbtn(c);
});
</script>
<div id="shomain_{rand}">
	<div class="rock-header">
		<div class="rock-header-left">
			<span clickevt="close" class="rock-header-btn"><i class="icon-angle-left"></i></span>
		</div>
		<div class="rock-header-text" id="name_{rand}"></div>
		<div class="rock-header-right" id="rightbtn_{rand}" clickevt="sendtools"></div>
	</div>
	
	<div resizes="206" id="viewcontent_{rand}" style="height:200px;overflow:auto;position:relative;"><div style="margin-top:50px" align="center"><i style="height:40px;width:40px" class="rock-loading"></i></div></div>
	
	<div class="toolsliao rock-border-b" clickevt="sendtools" style="background:white;display:">
		<span title="表情" tools="emts" class="toolsspan"><i class="icon-heart"></i></span><span title="文件/图片" tools="file" class="toolsspan"><i class="icon-folder-close"></i></span><span title="多选文件" tools="files" class="toolsspan"><i class="icon-folder-open"></i></span>
		<span tools="at" id="atspan_{rand}" style="font-size:16px" class="toolsspan"></span>
		
	</div>
	
	<!---->
	<div style="user-select:none;background:#f7f7f7;display:none" class="rock-border-t" id="footerother">
		<div style="display:flex;padding:12px 10px;align-items:center;">
			<div style="height:34px;overflow:hidden;width:34px"><img id="luyinbtn" src="images/logo.png" height="34px" width="34px"></div>
			<div style="flex:1;display:flex;margin:0px 10px">
				<textarea autocomplete="off" style="flex:1;height:42px;padding:0px 8px;border:none;border-radius:5px;background:white;" type="text" id="contentss" ondblclick="im{rand}.inputmax()" class="fontsize" onclick="this.focus()"></textarea>
			</div>
			<div>
				<button  type="button" id="btn"  class="webbtn">发送</button>
			</div>
		</div>
	</div>
	
	
	<div style="height:80px;overflow:hidden;background:white"><div style="height:70px;margin:5px"><textarea  style="background:none;width:100%;height:100%;overflow:auto;border:none;padding:0px"  id="input_content_{rand}"></textarea></div></div>
	
	<div style="height:40px;overflow:hidden;background:white"><div align="right"><input clickevt="close" class="webbtn" style="background:none;color:#aaaaaa" type="button" value="关闭">&nbsp;<input clickevt="send" class="webbtn" style="background:none;color:var(--main-color)"  type="button" value="发送"></div></div>
	
	
</div>